package com.appspot.codelab.docs.client.commands;

import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * A command for validating project details.
 */
public class SystemValidateProjectDetailsCommand extends Command {

  /**
   * The command's unique id.
   */
  public final static int serialUid = 201;
	
  protected String projectName;
  protected AsyncCallback<Boolean> callback;
  
  /**
   * Constructs a command for validating project details.
   * 
   * @param projectName the project name.
   * @param callback the callback to invoke with the validation outcome.
   */
  public SystemValidateProjectDetailsCommand(String projectName,
        AsyncCallback<Boolean> callback) {
	super("Validate project details.");
	this.projectName = projectName;
	this.callback = callback;
  }
  
  /**
   * Retrieves the callback to invoke with the validation outcome.
   * 
   * @return the callback to invoke with the validation outcome.
   */
  public AsyncCallback<Boolean> getCallback() {
	return callback;
  }

  /**
   * Retrieves the command's unique id.
   * 
   * @return the command's unique id.
   */
  @Override
  public int getCommandId() {
    return serialUid;
  }

  /**
   * Retrieves the project name.
   * 
   * @return the project name.
   */
  public String getProjectName() {
    return projectName;
  }

  /**
   * Sets the callback to invoke with the validation outcome.
   * 
   * @param callback the callback to invoke with the validation outcome.
   */
  public void setCallback(AsyncCallback<Boolean> callback) {
    this.callback = callback;
  }

  /**
   * Sets the project name.
   * 
   * @param projectName the project name.
   */
  public void setProjectName(String projectName) {
    this.projectName = projectName;
  }
  
}
